import instance from '../index'

// 加入购物车
export const addCart = (data) => {
  return instance({
    url: '/cart/addCart',
    method: 'post',
    data
  })
}

// 获取购物车列表
export const getCartList = (params) => {
  return instance({
    url: '/cart/getCartList',
    method: 'get',
    params
  })
}

// 删除购物车商品
export const delCart = (data) => {
  return instance({
    url: '/cart/deleteCart',
    method: 'post',
    data
  })
}

// 更新购物车状态
export const updateCart = (data) => {
  return instance({
    url: '/cart/updateCart',
    method: 'post',
    data
  })
}
